set_directory_properties(PROPERTIES SYSTEM TRUE)

INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
FILE(GLOB SOURCES *.cc)
LIST(SORT SOURCES)
ADD_LIBRARY(caps MODULE ${SOURCES})
INSTALL(TARGETS caps LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa")
IF(LMMS_BUILD_WIN64)
ADD_DEFINITIONS(-DLMMS_BUILD_WIN64)
ENDIF(LMMS_BUILD_WIN64)
SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "")

if(NOT MSVC)
	target_compile_options(caps PRIVATE -O2 -funroll-loops)
endif()

if(MSVC)
	target_link_options(caps PRIVATE "/EXPORT:ladspa_descriptor")
endif()

IF(LMMS_BUILD_WIN32)
	add_custom_command(
		TARGET caps
		POST_BUILD
		COMMAND "${STRIP_COMMAND}" "$<TARGET_FILE:caps>"
		VERBATIM
		COMMAND_EXPAND_LISTS
	)
ENDIF(LMMS_BUILD_WIN32)
